/**
   A class to convert degree, minute, seconds to decimal degrees
*/
public class Degrees
{
   /**
      Converts minutes and seconds to decimal degrees 
      @param degrees the degrees between -359 and 359
      @param minutes the minutes between 0 and 59
      @param seconds the minutes between 0 and 59
      @return the equivalent decimal degrees between -360 and 360 (exclusive)
   */
   public double decimalDegrees(int degrees, int minutes, int seconds)
   {
     double second=(Math.abs(seconds)/60.0)/60.0;
     double minute=Math.abs(minutes)/60.0;
     if(degrees>=0){
         return degrees+second+minute;
     }
      else{
         return degrees-second-minute;
      }
   }
}